<?php

namespace app\api\controller;

use app\common\controller\ApiAdminBase;
use app\common\model\BlessingRecord;
use think\Request;

class Blessing extends ApiAdminBase
{
    use \app\api\traits\Blessing;
    /**
     * 显示资源列表
     *
     * @return \think\Response
     */
    public function index()
    {
        //
    }

    /**
     * 显示资源列表
     *
     * @return \think\Response
     */
    public function adminList(Request $request)
    {
        $input = $request->param();
        $per_page = $input['per_page']??10;
        $condition = [];
        $data = BlessingRecord::getList($condition,[],['id desc'],$per_page);
        $data = $data ? $data->toArray() : [];
        $data['data'] = isset($data['data']) ? self::formatList($data['data']) : [];
        return $this->reply($data);
    }


    /**
     * 显示创建资源表单页.
     *
     * @return \think\Response
     */
    public function add()
    {
        //
    }


    /**
     * 显示编辑资源表单页.
     *
     * @param  int  $id
     * @return \think\Response
     */
    public function edit($id)
    {
        //
    }


    /**
     * 删除指定资源
     *
     * @param  int  $id
     * @return \think\Response
     */
    public function delete($id)
    {
        //
    }
}
